{extend name="layout/layout"}
{block name="content"}
<main class="user_page  ">
    <section class="">
        <div class="layui-main">
            <div class="user_con">
                <div class="user_headpage" data-load="user_active_header">
                    {include file="user_activity/page_menu" menu='advanced' id="$id" /}
                </div>
                <div class="right_main ">
                    <p class="ft24 mb10 ft-bold">进阶设置</p>
                    <p class="ft14 gary_c9 mb20 ft-bold">是否設為公開活動或公開顯示票券販售數量</p>
                    <div class="block_com" style="min-height: 80vh;">
                        <div class="active_w1 active3 " style="margin:  0 auto;">
                            <from class="layui-form" form-filter="info-form" action="" onsubmit="return false;">
                                <div class="content">
                                    <div class=" layui-form-item">
                                        <div class="d-flex jc-s al-c">
                                            <div class="label ">本活動是否公開顯示人數及票券數量？<p class=" tip1">活動剛開賣時建議不顯示</p>
                                            </div>
            
                                            <div class="">
                                                <input type="checkbox" name="show_tickets"  {if isset($act.show_tickets) && $act.show_tickets == 1} checked {/if}  value="1" title="是">
                                            </div>
                                        </div>
                                    </div>
                                    <div class=" layui-form-item">
                                        <div class="d-flex jc-s al-c">
            
                                            <div class="label">本活動是否為『非公開』活動？<p class=" tip1">活動若設為非公開活動時，將不能在平台上被找到</p>
                                            </div>
            
                                            <div class="">
            
                                                <input type="checkbox" name="un_public" {if isset($act.un_public) && $act.un_public == 1} checked {/if} value="1" title="是">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="mt40 d-flex jc-s al-c">
                                    <button class="layui-btn layui-btn-lg w100 layui-bg-orange next-btn"
                                             lay-submit lay-filter="advanced_form">储存
                                    </button>
                                </div>
                            </from>

                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
</main>

<script>
    layui.use(function () {
        var layer = layui.layer;
        var element = layui.element;
        var $ = layui.$;
        var form = layui.form;
        form.on('submit(advanced_form)', function(data){

            $.quickPost('/activity/user/activity/{$act.id}/advanced', data.field).done(res => {
 
                location.reload()
            });
            return false;
        });
    })
    // function save() {
    //     var data = layui.form.val('info-form');
    //     console.log(data);
    //     return;
    //     $.quickPost('/activity/user/activity/{$act.id}/advanced', data)
    // }
</script>

{/block}
